/*
 * D.cpp
 *
 *  Created on: 16 déc. 2013
 *      Author: Raphaël
 */

#include <iostream>
#include "raphTools/Tools.h"
#include "D.h"

using namespace raph;
using namespace raph::tools;
using namespace raph::type;

D::D(const int &a, const int &b, const int &c, const int& d) :
        A(a), B(a, b), C(a, c), m_d(d)
    {
    std::cout << "D constructor" << std::endl;
    }

D::~D()
    {
    std::cout << "D destructor" << std::endl;
    }

D& D::operator =(D&& obj)
    {
    std::cout << "D affectation move" << std::endl;
    m_a = obj.m_a;
    m_b = obj.m_b;
    m_c = obj.m_c;
    m_d = obj.m_d;
    return *this;
    }

D::D(D &&obj) :
        D(obj.m_a, obj.m_b, obj.m_c, obj.m_d)
    {
    std::cout << "D constructor move" << std::endl;
    }

void D::doSomething()
    {
    B::doSomething();
    std::cout << "D doSomething" << std::endl;
    }

std::string D::toString()
    {
    std::string str;
    str.append(Convert::numericToString<decltype(m_a)>(m_a));
    str.append(", ");
    str.append(Convert::numericToString<decltype(m_b)>(m_b));
    str.append(", ");
    str.append(Convert::numericToString<decltype(m_c)>(m_c));
    str.append(", ");
    str.append(Convert::numericToString<decltype(m_d)>(m_d));
    return str;
    }

